package com.zzyl.mapper;

import com.github.pagehelper.Page;
import com.zzyl.aop.AutoFill;
import com.zzyl.dto.NursingLevelPageQueryDto;
import com.zzyl.entity.NursingLevel;
import com.zzyl.vo.NursingLevelVo;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface NursingLevelMapper {


    Page<NursingLevelVo> getNursinglevlsByPage(NursingLevelPageQueryDto dto);

    @Select("select * from nursing_level where plan_id = #{id}")
    List<NursingLevel> ByPlanId(Long id);

    @AutoFill
    void add(NursingLevel level);

    @Select("select * from nursing_level where id = #{id}")
    NursingLevelVo getById(Long id);

    @AutoFill
    void update(NursingLevel level);

    @Delete("delete from nursing_level where id = #{id}")
    void delete(Long id);

    @Select("select * from nursing_level where status=1")
    List<NursingLevel> getAll();
}
